home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada,comp.lang.c++
- Path: in2.uu.net!world!bobduff
- From: bobduff@world.std.com (Robert A Duff)
- Subject: Re: some questions re. Ada/GNAT from a C++/GCC user
- Message-ID: <Dp74u6.8sM@world.std.com>
- Organization: The World Public Access UNIX, Brookline, MA
- References: <wnewmanDoxrCp.DKv@netcom.com> <Dp1oAw.7Cz@world.std.com> <ROGOFF.96Mar29163036@sccm.Stanford.EDU> <4jovi9$c2b@wdl1.wdl.loral.com>
- Date: Mon, 1 Apr 1996 18:32:30 GMT
-
- In article <4jovi9$c2b@wdl1.wdl.loral.com>,
- Mark A Biggar <mab@dst17.wdl.loral.com> wrote:
- >Yeah, 2 reasons. The first goes clear back to the original Ada Strawman
- >documnt which calls for a clear distinction between declarations and code
- >statements.
-
- But Ada does *not* have such a clear distinction. Declarations do lots
- of stuff at run time, in Ada. In Pascal, the "begin" makes sense --
- that's where execution starts; everything before that is purely
- compile-time declarative stuff. Not true in Ada. If you're dealing
- with Strings, for example, you often end up with *most* of the run-time
- algorithm *before* the "begin", because Ada's Strings can't change size,
- so you need to build up the result by declaring objects (usually
- constants) during elaboration.
-
- >... The second reason is that is also the method of wraping an
- >exception handler around soem arbitary piece of code:
-
- Nah, this doesn't explain why I need extra syntax for very local
- variables. It explains why I need extra syntax when there are exception
- handlers, but there usually aren't. So this is another case of the tail
- wagging the dog. It's fine to have extra syntax to delimit the region
- in which an exception handler applies, but that shouldn't complicate
- things for somebody who just wants to declare a variable, and doesn't
- want any exception handling.
-
- - Bob
-